export DEBIAN_FRONTEND="noninteractive"

if ! dpkg --status apt-cacher-ng &> /dev/null; then
  apt-get -qy install apt-cacher-ng
  service apt-cacher-ng restart || service apt-cacher-ng start
  grep "^MIRROR" /etc/default/lxc || (echo 'MIRROR="http://127.0.0.1:3142/archive.ubuntu.com/ubuntu"' | tee -a /etc/default/lxc)
fi
